#!/bin/sh

# http://downloads.openwrt.org/chaos_calmer/15.05/x86/generic/OpenWrt-ImageBuilder-15.05-x86-generic.Linux-x86_64.tar.bz2

# sudo apt-get install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev subversion flex uglifyjs texinfo sshpass
# 固件必须更名为类似 openwrt-15.05-x86-e8913a9e0dd02-20151122.img 的格式才能进行网页刷机.
# e8913a9e0dd02为固件文件自身的md5值的开头部分，取值长度随意，不要太短
set -x

packages="
ar
base-files
bash
binutils
blkid
busybox
bzip2
dnsmasq
dropbear
e2fsprogs
fdisk
firewall
fstools
gcc
grep
ip6tables
ip6tables-extra
ip6tables-mod-nat
iptables
iptables-mod-account
iptables-mod-chaos
iptables-mod-cluster
iptables-mod-clusterip
iptables-mod-condition
iptables-mod-conntrack-extra
iptables-mod-delude
iptables-mod-dhcpmac
iptables-mod-dnetmap
iptables-mod-extra
iptables-mod-filter
iptables-mod-fuzzy
iptables-mod-geoip
iptables-mod-hashlimit
iptables-mod-iface
iptables-mod-ipmark
iptables-mod-ipopt
iptables-mod-ipp2p
iptables-mod-iprange
iptables-mod-ipsec
iptables-mod-ipv4options
iptables-mod-led
iptables-mod-length2
iptables-mod-logmark
iptables-mod-lscan
iptables-mod-lua
iptables-mod-nat-extra
iptables-mod-nflog
iptables-mod-nfqueue
iptables-mod-psd
iptables-mod-quota2
iptables-mod-sysrq
iptables-mod-tarpit
iptables-mod-tee
iptables-mod-tproxy
iptables-mod-u32
iptables-mod-ulog
iptaccount
jshn
jsonfilter
kernel
kmod-crypto-aead
kmod-crypto-core
kmod-crypto-hash
kmod-crypto-manager
kmod-crypto-pcompress
kmod-dm
kmod-e1000
kmod-e1000e
kmod-hid
kmod-hid-generic
kmod-ikconfig
kmod-input-core
kmod-input-evdev
kmod-ip6tables
kmod-ip6tables-extra
kmod-ipt-account
kmod-ipt-chaos
kmod-ipt-cluster
kmod-ipt-clusterip
kmod-ipt-compat-xtables
kmod-ipt-condition
kmod-ipt-conntrack
kmod-ipt-conntrack-extra
kmod-ipt-core
kmod-ipt-delude
kmod-ipt-dhcpmac
kmod-ipt-dnetmap
kmod-ipt-extra
kmod-ipt-filter
kmod-ipt-fuzzy
kmod-ipt-geoip
kmod-ipt-hashlimit
kmod-ipt-iface
kmod-ipt-ipmark
kmod-ipt-ipopt
kmod-ipt-ipp2p
kmod-ipt-iprange
kmod-ipt-ipsec
kmod-ipt-ipv4options
kmod-ipt-led
kmod-ipt-length2
kmod-ipt-logmark
kmod-ipt-lscan
kmod-ipt-lua
kmod-ipt-nat
kmod-ipt-nat-extra
kmod-ipt-nat6
kmod-ipt-nflog
kmod-ipt-nfqueue
kmod-ipt-psd
kmod-ipt-quota2
kmod-ipt-sysrq
kmod-ipt-tarpit
kmod-ipt-tee
kmod-ipt-tproxy
kmod-ipt-u32
kmod-ipt-ulog
kmod-ipv6
kmod-lib-crc-ccitt
kmod-lib-raid6
kmod-lib-textsearch
kmod-lib-xor
kmod-loop
kmod-md-linear
kmod-md-mod
kmod-md-multipath
kmod-md-raid0
kmod-md-raid1
kmod-md-raid10
kmod-md-raid456
kmod-mii
kmod-nf-conntrack
kmod-nf-conntrack6
kmod-nf-ipt
kmod-nf-ipt6
kmod-nf-nat
kmod-nf-nat6
kmod-nf-nathelper
kmod-nfnetlink
kmod-nfnetlink-log
kmod-nfnetlink-queue
kmod-nls-base
kmod-ppp
kmod-pppoe
kmod-pppox
kmod-pps
kmod-ptp
kmod-r8169
kmod-slhc
kmod-usb-core
kmod-usb-hid
libacl
libattr
libbfd
libblkid
libblobmsg-json
libbz2
libc
libext2fs
libgcc
libip4tc
libip6tc
libjson-c
libjson-script
libncurses
libnl-tiny
libopcodes
libopenssl
libpcre
libpthread
librt
libsmartcols
libstdcpp
libubox
libubus
libuci
libuuid
libxtables
mtd
netifd
objdump
odhcp6c
odhcpd
opkg
ppp
ppp-mod-pppoe
procd
r8169-firmware
tar
terminfo
tune2fs
ubox
ubus
ubusd
uci
udev
unzip
usign
zlib
kmod-usb2
kmod-usb3
kmod-usb-storage
kmod-usb-storage-extras
block-mount kmod-fs-ext4
swap-utils
lighttpd-mod-cgi
lighttpd
kmod-scsi-core
kmod-scsi-generic
kmod-md-mod
kmod-md-raid0
kmod-pcnet32
kmod-ne2k-pci
kmod-8139cp
kmod-8139too
lvm2
kmod-ide-core
kmod-ide-generic
shadow-useradd
haserl
libdevmapper
"
make image PACKAGES="`echo "$packages" | tr '\n' ' '`" FILES=./files
